package com.whstudio.util.mvc.data.sql;

import com.whstudio.common.memory.item.AbstractItem;

public class DatabaseParameter extends AbstractItem implements IParameter {
	private Integer typeInteger;
	private Object valueObject;
	private Boolean defaultBoolean;
	
	public DatabaseParameter(String nameString){
		super(nameString);
	}
	
	@Override
	public Boolean isDefault(){
		return defaultBoolean==null?false:defaultBoolean;
	}
	
	public void setDefault(Boolean defaultBoolean){
		this.defaultBoolean=defaultBoolean;
	}
	
	@Override
	public Integer getType() {
		return typeInteger;
	}

	@Override
	public Object getValue() {
		
		return valueObject;
	}

	@Override
	public void setType(Integer typeInteger) {
		this.typeInteger=typeInteger;
	}

	@Override
	public void setValue(Object valueObject) {
		this.valueObject=valueObject;
	}
	
	@Override
	public void setDefaultValue(Object valueObject,Boolean isDefaultBoolean){
		if(isDefaultBoolean){
			this.defaultBoolean=true;
		}
		this.valueObject=valueObject;
	}

	@Override
	public String getName() {
		return getNameString();
	}

	@Override
	public void move() {
		
	}

	@Override
	public void setName(String nameString) {
		setNameString(nameString);
	}

}
